﻿using Microsoft.AspNetCore.Http;

namespace WT.OpenIddict.Domain.Services.Exceptions;

public class UnifiedException : Exception
{
    public UnifiedException(
        string message,
        int httpStatusCode = StatusCodes.Status500InternalServerError,
        string errorCode = "system_error",
        Dictionary<string, object> extensions = null)
        : base(message)
    {
        HttpStatusCode = httpStatusCode;
        ErrorCode = errorCode;
        Extensions = extensions ?? new Dictionary<string, object>();
    }

    public int HttpStatusCode { get; }
    public string ErrorCode { get; }
    public Dictionary<string, object> Extensions { get; }
}